﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace Bank_database_system.财务部
{
    partial class 资金查看 : UserControl
    {
        资金调度b funding_sch = new();
        public 资金查看()
        {
            InitializeComponent();
            label2.Text = AccountCheck.branchname;
            dataGridView1.DataSource = Finance.GetFundStorage(AccountCheck.branchid);
            dataGridView1.RowHeadersVisible = false;
            dataGridView1.AllowUserToAddRows = false; // 禁用添加空白行
            dataGridView1.AllowUserToResizeColumns = false;
            dataGridView1.AllowUserToResizeRows = false;
            dataGridView1.ReadOnly = true;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
            funding_sch.ButtonBack += BackToA;
        }
        private void BackToA(object sender, EventArgs e)
        {
            // 修改支行信息a中的控件状态
            dataGridView1.DataSource = Finance.GetFundStorage(AccountCheck.branchid);
            panel1.Visible = false;
            panel1.Controls.Clear();
            funding_sch = new();
            funding_sch.ButtonBack += BackToA;
        }
        private void 资金查看_Load(object sender, EventArgs e)
        {

        }
        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void button9_Click(object sender, EventArgs e)
        {
            panel1.Visible = true;
            panel1.Controls.Clear();
            panel1.Controls.Add(funding_sch);
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }
    }
}
